|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
This class is used for controlling all template operations. This class uses a parser created by JavaCC to create an AST that is subsequently traversed by a Visitor. * Template template = Velocity.getTemplate("test.wm"); Context context = new VelocityContext(); * context.put("foo", "bar"); context.put("customer", new Customer()); * template.merge(context, writer); *
Fields inherited from class NVelocity.Runtime.Resource.Resource |
---|
data, encoding, lastModified, modificationCheckInterval, name, nextCheck, resourceLoader, rsvc |
Constructor Summary | |
---|---|
Template() Default constructor |
Properties inherited from class NVelocity.Runtime.Resource.Resource |
---|
Data, Encoding, LastModified, ModificationCheckInterval, Name, ResourceLoader, RuntimeServices |
Method Summary | |
---|---|
void |
InitDocument() initializes the document. init() is not longer dependant upon context, but we need to let the init() carry the template name down throught for VM namespace features |
void |
Merge(NVelocity.Context.IContext context, System.IO.TextWriter writer) The AST node structure is merged with the context to produce the final output. * Throws IOException if failure is due to a file related issue, and Exception otherwise * |
bool |
Process() gets the named resource as a stream, parses and inits * |
Methods inherited from class NVelocity.Runtime.Resource.Resource |
---|
IsSourceModified, RequiresChecking, Touch |
Methods inherited from class System.Object |
---|
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString |
Constructor Detail |
---|
public Template()
Default constructor
Method Detail |
---|
public void InitDocument()
initializes the document. init() is not longer dependant upon context, but we need to let the init() carry the template name down throught for VM namespace features
public void Merge(NVelocity.Context.IContext context, System.IO.TextWriter writer)
The AST node structure is merged with the context to produce the final output. * Throws IOException if failure is due to a file related issue, and Exception otherwise *
Parameters:
context
- Conext with data elements accessed by template
writer
- output writer for rendered template
@throws ResourceNotFoundException if template not found
from any available source.
@throws ParseErrorException if template cannot be parsed due
to syntax (or other) error.
@throws Exception anything else.
public bool Process()
gets the named resource as a stream, parses and inits *
Returns:
|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |